package br.unb.mestrado.simulator.model.simulator;

public class ContextConfiguration {

	private Integer id;
	
	private Boolean accEnabled;
	private Boolean ecgEnabled;
	private Boolean spo2Enabled;
	private Boolean tempEnabled;

	private Double accBattery;
	private Double ecgBattery;
	private Double spo2Battery;
	private Double tempBattery;

	private Double accSample;
	private Double ecgSample;
	private Double spo2Sample;
	private Double tempSample;

	public ContextConfiguration() {
		// TODO Auto-generated constructor stub
	}
	
	
	public ContextConfiguration(Integer id) {
		super();
		this.id = id;
	}


	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Double getAccBattery() {
		return accBattery;
	}
	public void setAccBattery(Double accBattery) {
		this.accBattery = accBattery;
	}
	public Boolean getAccEnabled() {
		return accEnabled;
	}
	public void setAccEnabled(Boolean accEnabled) {
		this.accEnabled = accEnabled;
	}
	public Double getAccSample() {
		return accSample;
	}
	public void setAccSample(Double accSample) {
		this.accSample = accSample;
	}
	public Double getEcgBattery() {
		return ecgBattery;
	}
	public void setEcgBattery(Double ecgBattery) {
		this.ecgBattery = ecgBattery;
	}
	public Boolean getEcgEnabled() {
		return ecgEnabled;
	}
	public void setEcgEnabled(Boolean ecgEnaled) {
		this.ecgEnabled = ecgEnaled;
	}
	public Double getEcgSample() {
		return ecgSample;
	}
	public void setEcgSample(Double ecgSample) {
		this.ecgSample = ecgSample;
	}
	public Double getSpo2Battery() {
		return spo2Battery;
	}
	public void setSpo2Battery(Double spo2Battery) {
		this.spo2Battery = spo2Battery;
	}
	public Boolean getSpo2Enabled() {
		return spo2Enabled;
	}
	public void setSpo2Enabled(Boolean spo2Enabled) {
		this.spo2Enabled = spo2Enabled;
	}
	public Double getSpo2Sample() {
		return spo2Sample;
	}
	public void setSpo2Sample(Double spo2Sample) {
		this.spo2Sample = spo2Sample;
	}
	public Double getTempBattery() {
		return tempBattery;
	}
	public void setTempBattery(Double tempBattery) {
		this.tempBattery = tempBattery;
	}
	public Boolean getTempEnabled() {
		return tempEnabled;
	}
	public void setTempEnabled(Boolean tempEnabled) {
		this.tempEnabled = tempEnabled;
	}
	public Double getTempSample() {
		return tempSample;
	}
	public void setTempSample(Double tempSample) {
		this.tempSample = tempSample;
	}
	
	public String toComboString() {
		
		String accStr = "ACC(";
		accStr += accEnabled?"A-ACT":"A-INAC";
		accStr += ", Bat:"+accBattery;
		accStr += ", Sam:"+accSample;
		accStr += ")";
		
		String tempStr = "TEMP(";
		tempStr += tempEnabled?"T-ACT":"T-INAC";
		tempStr += ", Bat:"+tempBattery;
		tempStr += ", Sam:"+tempSample;
		tempStr += ")";
		
		String spo2Str = "SPO2(";
		spo2Str += spo2Enabled?"S-ACT":"S-INAC";
		spo2Str += ", Bat:"+spo2Battery;
		spo2Str += ", Sam:"+spo2Sample;
		spo2Str += ")";
		
		String ecgStr = "ECG(";
		ecgStr += ecgEnabled?"E-ACT":"E-INAC";
		ecgStr += ", Bat:"+ecgBattery;
		ecgStr += ", Sam:"+ecgSample;
		ecgStr += ")";

		return accStr+ " "+tempStr+ " "+spo2Str+ " "+ecgStr;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContextConfiguration other = (ContextConfiguration) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	public ContextConfiguration cloneInstance() {
		ContextConfiguration clone = new  ContextConfiguration();
		clone.id = getId();
		clone.accEnabled = getAccEnabled();
		clone.ecgEnabled = getEcgEnabled();
		clone.spo2Enabled = getSpo2Enabled();
		clone.tempEnabled = getTempEnabled();
		
		clone.accBattery = getAccBattery();
		clone.ecgBattery = getEcgBattery();
		clone.spo2Battery = getSpo2Battery();
		clone.tempBattery = getTempBattery();
		
		clone.accSample = getAccSample();
		clone.ecgSample = getEcgSample();
		clone.spo2Sample = getSpo2Sample();
		clone.tempSample = getTempSample();
		
		return clone;
	}
	
	
}
